import Vue from 'vue'
import VueRouter from 'vue-router'
import WebLogin from '../views/WebLogin'
import index from '../views/index'
import hello from '../views/Permission'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/webLogin',
    name: 'WebLogin',
    component: WebLogin
  },
  {
    path: '/index',
    name: 'Index',
    component: index,
    children:[
      {
        path: '/permission',
        name: 'Permission',
        component: () => import('../views/Permission'),
      },
      {
        path: '/helloo',
        name: 'Helloo',
        component: () => import('../views/helloo'),
      }
    ]
  },
  {
    path: '/hello',
    name: 'Hello',
    component: hello
  }
]

const router = new VueRouter({
  routes
})

export default router
